package com.scd.jmeter.rmi.common;

import java.util.Properties;

public interface JMeterEngine {

    /**
     * Configure engine
     * @param testPlan the test plan
     */
    void configure(TestPlan testPlan);

    /**
     * Runs the test
     */
    void runTest();

    /**
     * Stop test immediately interrupting current samplers
     */
    default void stopTest() {
        stopTest(true);
    }
    /**
     *
     * @param now boolean that tell whether stop is immediate (interrupt) or not (wait for current sample end)
     */
    void stopTest(boolean now);

    /**
     * Stop test if running
     */
    void reset();

    /**
     * set Properties on engine
     * @param p the properties to set
     */
    void setProperties(Properties p);

    /**
     * Exit engine
     */
    void exit();

    /**
     * @return boolean Flag to show whether engine is active (true when test is running). Set to false at end of test
     */
    boolean isActive();
}
